import java.util.Scanner;

public class demo1 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        int x= input.nextInt();
        print(x);
        System.out.println(print(x));
    }
    public static int print(int x) {
       if(x<10){
           return x;

        }
       return x%10+print(x/10);

    }
}
